package com.wiretrack.circuit;

import java.awt.Color;

import org.apache.log4j.Logger;

public class FlashColorRGB
{
	private static Logger log = Logger.getLogger(FlashColorRGB.class.getName());
	
	private Color color;
	public String rgb;
	
	public Color getColor()
	{
		String[] colors = rgb.split(",");
		
		if(colors != null && colors.length == 3)
		{
			int red = Integer.parseInt(colors[0].trim());
			int green = Integer.parseInt(colors[1].trim());
			int blue = Integer.parseInt(colors[2].trim());
			
			color = new Color(red, green, blue);
		}
		
		return color;
	}
	
	public String toString()
	{
		StringBuilder buf = new StringBuilder();
		buf.append("Color: " + rgb);
		
		return buf.toString();
	}
}
